using System.Collections.Generic;
using Category = Autodesk.Revit.DB.Category;
using Autodesk.Revit.DB;

namespace BIM.XML3DExport
{
    /// <summary>
    /// The range of elements to be exported.
    /// </summary>
    public enum ElementsExportRange
    {
        All = 0,
        OnlyVisibleOnes
    }

    /// <summary>
    /// Settings made by user to export.
    /// </summary>
    public struct Settings
    {
        private ElementsExportRange m_ExportRange;
        private bool m_IncludeLinkedModels;
        private Dictionary<string, Category> m_SelectedCategories;
        private DisplayUnitType m_Units;

        /// <summary>
        /// The range of elements to be exported.
        /// </summary>
        public ElementsExportRange ExportRange
        {
            get
            {
                return m_ExportRange;
            }
        }

        /// <summary>
        /// Include linked models.
        /// </summary>
        public bool IncludeLinkedModels
        {
            get
            {
                return m_IncludeLinkedModels;
            }
        }

        /// <summary>
        /// Include selected categories.
        /// </summary>
        public Dictionary<string, Category> SelectedCategories
        {
            get
            {
                return m_SelectedCategories;
            }
        }

        public DisplayUnitType Units
        {
           get
              {
                 return m_Units;
              }
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="saveFormat">The file format.</param>
        /// <param name="exportRange">The export range.</param>
        public Settings( ElementsExportRange exportRange)
        {
            m_ExportRange = exportRange;
            m_IncludeLinkedModels = false;
            m_SelectedCategories = new Dictionary<string, Category>();
            m_Units = DisplayUnitType.DUT_UNDEFINED;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="saveFormat">The file format.</param>
        /// <param name="exportRange">The export range.</param>
        /// <param name="includeLinkedModels">True to include linked models, false otherwise.</param>
        /// <param name="selectedCategories">The selected categories to be included.</param>
        public Settings( ElementsExportRange exportRange, bool includeLinkedModels,
            Dictionary<string, Category> selectedCategories, DisplayUnitType units)
        {
            m_ExportRange = exportRange;
            m_IncludeLinkedModels = includeLinkedModels;
            m_SelectedCategories = selectedCategories;
            m_Units = units;
        }
    }
}
